<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>奶茶店后台管理系统</title>
    <link th:href="@{/layui/css/layui.css}" rel="stylesheet" />
</head>

<style>
.img{
    max-height:350px;
    max-width: 350px;
    vertical-align:middle;
}
</style>

<body class="layui-layout-body">
<div class="layui-layout layui-layout-admin">
    <!--    引入导航栏组件-->
    <div th:insert="components/main::navbar"></div>
    <!--    引入侧边栏组件 -->
    <div th:insert="components/main::siderbarnone"></div>

    <div class="layui-body">
        <form class="layui-form" method="post" th:action="@{/manage/update}" enctype="multipart/form-data" style="width: 500px;margin: 50px auto;">

                <div class="layui-form-item layui-hide">
                    <label class="layui-form-label">产品ID</label>
                    <div class="layui-input-inline">
                        <input type="text" name="id" th:value="${Product.getId()}" required lay-verify="required" autocomplete="off" class="layui-input layui-disabled">
                        <div class="layui-form-mid layui-word-aux" th:text="产品ID"></div>
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">产品名</label>
                        <div class="layui-input-inline">
                            <input type="text" name="name" th:value="${Product.getName()}" required lay-verify="required" placeholder="请输入产品名" autocomplete="off" class="layui-input">
                            <div class="layui-form-mid layui-word-aux" th:text="产品名称"></div>

                        </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">产品类别</label>
                    <div class="layui-input-inline" th:if="${Product.getCategory()==1}">
                        <input type="radio" name="category" value="1" title="奶茶" checked>
                        <input type="radio" name="category" value="2" title="咖啡">
                    </div>
                    <div class="layui-input-inline" th:if="${Product.getCategory()==2}">
                        <input type="radio" name="category" value="1" title="奶茶" >
                        <input type="radio" name="category" value="2" title="咖啡" checked>
                    </div>
                    <div class="layui-form-mid layui-word-aux" th:text="产品类别"></div>
                </div>


                <div class="layui-form-item">
                    <label class="layui-form-label">价格</label>
                    <div class="layui-input-inline">
                        <input type="text" name="price" th:value="${Product.getPrice()}" required lay-verify="required" placeholder="请输入产品名" autocomplete="off" class="layui-input">
                        <div class="layui-form-mid layui-word-aux" th:text="产品价格"></div>

                    </div>
                </div>


                <div class="layui-form-item">
                    <label class="layui-form-label">产品描述</label>
                    <div class="layui-input-inline">
                        <textarea name="remark" th:text="${Product.getRemark()}" required lay-verify="required" th:placeholder="请输入" class="layui-textarea"></textarea>
                    </div>
                    <div class="layui-form-mid layui-word-aux" th:text="产品描述"></div>
                </div>


                <div class="layui-form-item">
                    <label class="layui-form-label">产品原图片</label>
                    <div class="layui-input-inline">
                        <img class="img" th:src="${Product.getPicdata()}" alt="图片失效，请联系管理员！">
                    </div>
                    <div class="layui-form-mid layui-word-aux"></div>
                </div>



                <div class="layui-form-item">
                    <label class="layui-form-label">奶茶图片</label>
                    <div class="layui-input-inline">
                        <input name="img" type="file" class="layui-upload-button">
                    </div>
                    <div class="layui-form-mid layui-word-aux" th:text="仅支持小于1MB"></div>
                </div>

                <div class="layui-form-item">
                    <div class="layui-input-block">
                        <button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
                        <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                    </div>
                </div>

        </form>
    </div>

<!--    <div th:insert="components/main::bottombar"></div>-->

</div>

<script th:src="@{/layui/layui.js}"></script>

</body>
</html>